<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看运单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../plugins/layui/css/myPage.css">

</head>
<body  >
<div class="layui-container">


    <form class="layui-form">
        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>回车报账退回</legend>


                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 90px"  >运单号 </label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="ydh"   lay-verify="" placeholder="请输入" id="ydh" class="layui-input" disabled="disabled" >

                            <input   type="hidden" name="ydid"  >
                            <input   type="hidden" name="sfcz" value="1"  >
                            <input   type="hidden" name="sfscdd" value="1"  >
                        </div>



                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 90px" >当前状态</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <select name="ydzt"  lay-verify="" disabled="disabled" >

                                    <option value="待调度">待调度</option>
                                    <option value="待发车">待发车</option>
                                    <option value="已发车">已发车</option>
                                    <option value="已回车">已回车</option>
                                    <option value="已完成">已完成</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="width: 90px" >申请退回状态</label>
                            <div class="layui-input-inline" style="width: 150px;">
                                <select name="sqthzt"  lay-verify=""  >
                                    <option value=""></option>

                                    <option value="报账_已回车" selected>已回车</option>
                                </select>
                            </div>
                        </div>

                    </div>
                    <div class="layui-form-item">

                        <label class="layui-form-label"><span style="color: red;">*</span>申请原因</label>
                        <div class="layui-input-block" style="width: auto ;">
                            <textarea  style="height: auto" class="layui-textarea" name="sqyy"  required  lay-verify="required" placeholder="请输入"     ></textarea>
                        </div>

                    </div>


                    <div class="layui-form-item" style="position: relative;left: 50%">
                        <label class="layui-form-label" style="width: 90px" disabled="disabled">申请人</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="sqr" id="sqr"  lay-verify="" placeholder="请输入"  class="layui-input"  >
                        </div>


                        <label class="layui-form-label" style="width: 90px">申请日期</label>
                        <div class="layui-input-inline" style="width: 150px;">
                            <input   type="text" name="sqrq" id="sqrq"   lay-verify="" placeholder="请输入"  class="layui-input" disabled="disabled" >
                        </div>

                    </div>



                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: auto">注意：运单一旦退回至某状态，其流转期间产生的相关数据均会删除，如，运单由“已发车”退回至“待调度”，则关联的“车牌号”将删除！</label>
                    </div>
                    <!--<div class="layui-form-item">-->
                    <!--<div class="layui-input-block" style="position: relative;left: 370px">-->

                </fieldset>
                <button id="modiSub" class="layui-btn layui-btn-normal  "   lay-submit lay-filter="update" style="position: absolute;left: 45%;width: 10%">立即提交</button>
            </div>
        </div>



    </form>
</div>
<script src="../plugins/layui/layui.js"></script>
<script src="../js/config.js"></script>
<script src="../js/tools.js"></script>
<script>
    layui.use(['table','form','layer','laydate','upload'],function () {

        var form = layui.form;
        var $ = layui.$;
        var layer = layui.layer;
        var laydate = layui.laydate;

        //自动获取经手人
        $.ajax({
            url: contextPath+"/currentUser",
            type: "GET",
            contentType:"application/json;charset=utf-8",
            dataType:"json",
            success: function(res) {
                currentUser = res.yhm;
                console.log(res);
                $("#sqr").val(currentUser);
            }
        });

        $("#modiInfo").on('click',function(){
            $("#huowu,#hwsl,#yunfei,#gls,#ydj").removeClass("layui-disabled");
            $("#huowu,#hwsl,#yunfei,#gls,#ydj").removeAttr("disabled",true);

            $("#modiSub").removeClass("layui-btn-disabled");
            $("#modiSub").removeAttr("disabled");

            $("#modiInfo").addClass("layui-btn-disabled");
            $("#modiInfo").attr("disabled",true);
        });



        laydate.render({
            elem: '#sqrq' //指定元素
            ,theme:'#0099FF'
            ,value: getFormatDate()
            ,type: 'date'
            ,format:'yyyy-MM-dd'
        });








        form.on('submit(update)', function(data){
            console.log(data.field);
            $("input").css("border","");
            $.ajax({
                url: contextPath+"/error/",
                type: "POST",
                contentType:"application/json;charset=utf-8",
                data: JSON.stringify(data.field) ,
                dataType:"json",
                success: function(res) {
                    updateSuccess($,layer,res)
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });

</script>
</body>
</html>